//
//  FillmTableViewCell.m
//  简单豆瓣不得不交版 1 带
//
//  Created by dllo on 16/6/23.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "FillmTableViewCell.h"
#import "FilmModel.h"
#import "UIImageView+WebCache.h"

@implementation FillmTableViewCell


- (void)dealloc
{
    
    [_smallImageView release];
    [_myImageView release];
    [_myLabel release];
    [super dealloc];
}


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self doIt];
    }
    return self;
}


- (void)doIt {
    
    self.myImageView = [[UIImageView alloc] init];
    self.myImageView.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:self.myImageView];
    self.myImageView.image = [UIImage imageNamed:@"bg_eventlistcell@2x.png"];
    [_myImageView release];

    self.smallImageView = [[UIImageView alloc] init];
    self.smallImageView.backgroundColor = [UIColor orangeColor];
    [self.myImageView addSubview:self.smallImageView];
    [_smallImageView release];
    
    self.myLabel = [[UILabel alloc] init];
  //  self.myLabel.backgroundColor = [UIColor cyanColor];
    [self.myImageView addSubview:self.myLabel];
    self.myLabel.font = [UIFont systemFontOfSize:20];
    [_myLabel release];

    
}

- (void)layoutSubviews{
    [super layoutSubviews];
    
    self.myImageView.frame = CGRectMake(15, 10, 384, 140);
    self.smallImageView.frame = CGRectMake(18, 11, 98, 121);
    self.myLabel.frame = CGRectMake(145, 55, 250, 30);
    
}

- (void)setModel:(FilmModel *)model{

    if (_model != model) {
        [_model release];
        _model = [model retain];
            
    
}
    
    NSURL *url = [NSURL URLWithString:model.pic_url];
    [self.smallImageView sd_setImageWithURL:url];
    
    self.myLabel.text = model.movieName;
  
    

}



@end
